<?php
class  Front_Model_DbTable_Jobsearch extends  Kieumau_Db_Common
{
    protected $_name = 'job_search' ;
	
	public function getJobSearch($order, $status = 1){
		try {
			$sql = 'SELECT a.job_id, b.id as province_id, b.name as province_name, c.title, d.companyname, c.description
					FROM job_search a INNER JOIN province b
						ON a.province_id = b.id
					INNER JOIN job c
						ON a.job_id = c.id
					INNER JOIN employer d
						ON c.employer_id = d.id
					WHERE a.status = ?
					ORDER BY '.$order;
			$this->_db->setFetchMode(Zend_Db::FETCH_ASSOC);
			$result = $this->_db->fetchAll ( $sql, array($status));
			return $result;
		} catch ( Exception $ex ) {
			echo "<br/> Can not get job Seach, <br/>Error: " . $ex->getMessage ();
			exit ();
		}
	}
}












